<?php
/**
 * 2021/3/9
 * Created by breeze
 * User: breeze
 */
namespace app\admin\controller;


use app\admin\business\indexBus;
use think\facade\View;

class Index extends AdminBase
{
    public function index()
    {
        $sessionData = session(config('admin.session_admin'));
        View::assign('id',$sessionData['id']);
        return View::fetch();
    }
    public function welcome(){
        return View::fetch();
    }
    public function getTenderCount(){
        $where = $this->request->param('where');
        $indexBus = new indexBus();
        $res = $indexBus->getTenderCountBus($where);
        return show(config('status.success'),'获取成功',$res);
    }

    public function getMemberInfoCount(){
        $where = $this->request->param('where');
        $indexBus = new indexBus();
        $res = $indexBus->getMemberInfoCountBus($where);
        return show(config('status.success'),'获取成功',$res);
    }
    public function getAdminByWhere(){
        $id = $this->request->param('id');
        $indexBus = new indexBus();
        try {
            $res = $indexBus->getAdminByWhereBus($id);
        }catch (\Exception $exception){
            return show(config('status.error'),$exception->getMessage());
        }
        return show(config('status.success'),'获取成功',$res);
    }
}